﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="GerenciarCurso.aspx.cs" Inherits="CursoUNICEUB.GerenciarCurso" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
 <script type="text/javascript" language="javascript">
     function mostrarEmail() {
         $("#Email").show("slow");
         $("#lblEmail").hide("slow");

}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <h1>
        Gerenciar Cursos</h1>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
        DataSourceID="LinqDataSource1" ForeColor="#333333" GridLines="None" Width="100%">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="NomeAluno" HeaderText="Aluno" ReadOnly="True" SortExpression="NomeAluno">
                <ControlStyle Width="30%" />
                <HeaderStyle Width="30%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="EmailAluno" HeaderText="Email" ReadOnly="True" SortExpression="EmailAluno">
                <ControlStyle Width="30%" />
                <HeaderStyle Width="30%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="TelefoneAluno" HeaderText="Telefone" ReadOnly="True" SortExpression="TelefoneAluno">
                <ControlStyle Width="20%" />
                <HeaderStyle Width="20%" HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="A/D">
                <HeaderStyle Width="20%" HorizontalAlign="Center" />
                <ItemTemplate>
                    <asp:Button Text='<%#Eval("StPagoAluno")%>' CommandArgument='<%# Eval("CodAluno") %>'
                        runat="server" ID="btnAcao" OnClick="btnAcao_Click" />
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <div style="text-align: center;" >
    <div id="Email" style="text-align: center; display:none">
        <asp:TextBox ID="txtEmail" runat="server" Height="90px" Width="342px" BorderColor="#0066FF"
            TextMode="MultiLine"></asp:TextBox>
        <br />
        <div style="text-align: right; width: 80%;">
            <asp:Button ID="btnEnviarEmail" runat="server" Text="Enviar Email" 
                onclick="btnEnviarEmail_Click"/>
        </div>
        
    </div>
    <label id="lblEmail" style="color:Green; vertical-align:middle "  onclick="mostrarEmail();">Enviar E-mail</label>
    </div>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="FastDATA.DCCursoDataContext"
        EntityTypeName="" Select="new (NomeAluno, EmailAluno, TelefoneAluno, StPagoAluno, CodAluno)"
        TableName="DECursoAlunos" Where="CodigoCurso == @CodigoCurso">
        <WhereParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="CodigoCurso" QueryStringField="codigo"
                Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
